package com.jyh.homework.homework1;

import java.io.FileWriter;

/**
 * @Author JYH
 * @Date 2024/8/6 19:41
 * @Description 实现字符串和字节数组之间的相互转换。比如将字符串“湖北软帝”转换为字节数组，并将字节数组再转换回字符串。
 */
public class Homework1 {
    public static void main(String[] args) {
        //新建字符串"湖北软帝"
        String str = "湖北软帝";
        //将字符串转为字节数组
        byte[] bytes1 = str.getBytes();
        //将字节数组用字符串打印输出
        System.out.println(new String(bytes1));
    }
}
